import { WECHAT, BYTEDANCE, HTML5 } from 'cc/env';

// 不同平台有不一样的设置，这里用一个类封装起来
export class PlatformSetting {
  public static isHTML5() {
    return HTML5;
  }
  public static isByteDance() {
    return BYTEDANCE
  }
  // 统一设置入口
  uniSetting() {
    if (WECHAT) {
      this.wxSetting();
    } else if (BYTEDANCE) {
      this.ttSetting();
    }
  }
  wxSetting() {
    //设置开启默认分享何朋友圈的设置
    wx.showShareMenu({
        withShareTicket: true,
        menus: ['shareAppMessage', 'shareTimeline']
    });
    wx.setKeepScreenOn({
      keepScreenOn: true
    })
  }
  ttSetting() {
    tt.setKeepScreenOn({keepScreenOn: true});
  }
}